<%-- 
    Document   : user_obs_view
    Created on : May 30, 2014, 4:50:26 PM
    Author     : Mansur
--%>

<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>.: User Observation Flag :.</title>
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.blockUI.js"></script>
        <script type="text/javascript">
            $(function() {
                $("#dialog-form").dialog({
                    autoOpen: false,
                    height: 300,
                    width: 450,
                    modal: true,
                    buttons: {
                        "Save": function() {
                            var frm = document.forms.popupForm;
                            frm.action = frm.action + '?save';
                            frm.submit();
                        },
                        Cancel: function() {
                            $(this).dialog("close");
                        }
                    },
                    close: function() {
                    }
                });

            });
            
            function popEdit(id){
                var url = '${pageContext.request.contextPath}/adminObsStatus?editUser&id=' + id;
                $.get(url, function(data){
                    $('#dialog-form').html(data);
                });
                $('#dialog-form').dialog("open");
            }
        </script>
    </head>
    <body>
        <s:messages />
        <s:errors />
        <s:form beanclass="exatrez.stripes.action.UserObsAdminAction" name="formList">
             <div>
                <fieldset>
                    <div id="page-title">
                        <span class="title">User Observation Status</span>
                    </div>
                    <div>
                        <span class="sub-title">List user on selected group (Crewing, Procurement, HSSE, ISM)</span><br />
                        <display:table class="tablecloth" name="${actionBean.listUser}" requestURI="/adminObs?viewUser" id="line" >
                            <display:column title="No."><center>${line_rowNum}.</center></display:column>
                            <display:column title="UserID" property="user.userId" />
                            <display:column title="Group Name" property="group.groupName" />
                            <display:column title="Observation Status">
                                <c:if test="${line.obsFlag eq 'T'}">
                                    Allow Response
                                </c:if>
                                <c:if test="${line.obsFlag eq 'F'}">
                                    Not Allow Response
                                </c:if>
                            </display:column>
                            <display:column title="action" >
                                <center>
                                    <img alt='Click for Edit' border='0' src='${pageContext.request.contextPath}/images/icon/edit.png' 
                                        onclick="popEdit('${line.userGroupId}');return false;" onmouseover="this.style.cursor = 'pointer';">
                                </center>
                            </display:column>
                        </display:table>
                    </div>
                </fieldset>
             </div>
        </s:form>
        <div id="dialog-form" title="Edit User Observation Status">
        </div>
    </body>
</html>